package cn.dengta.webapp.im.entity;

import java.util.Date;

import cn.dengta.common.model.Status;
import cn.dengta.webapp.base.entity.TimeBasedEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import me.codeplayer.util.StringUtil;

/**
 * 用户自定义搭讪字段信息变更记录表
 *
 * @author lgy
 * @since 2022-07-01
 */
@Setter
@Getter
@Accessors(chain = true)
public class UserGreetTextLog extends TimeBasedEntity {

	/** 操作用户ID */
	private Long userId;
	/** 自定义搭讪语ID */
	private Long targetId;
	/** 原字段信息 */
	private String old;
	/** 新字段信息 */
	private String current;
	/** 备注信息 */
	private String remark;
	/** 显示状态：1=显示；0=隐藏 2=拒绝*/
	private Integer status;

	public UserGreetTextLog init(Long userId, Long targetId, String old, String current, String remark, Date now) {
		this.userId = userId;
		this.targetId = targetId;
		this.old = StringUtil.toString(old);
		this.current = StringUtil.toString(current);
		this.remark = StringUtil.toString(remark);
		this.status = Status.YES.value;
		super.initTime(now);
		return this;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	public static final String USER_ID = "user_id";
	public static final String TARGET_ID = "target_id";
	public static final String OLD = "old";
	public static final String CURRENT = "current";
	public static final String REMARK = "remark";
	public static final String STATUS = "status";

}
